package com.parsechina.hpush.broker.parser;

import io.netty.handler.codec.mqtt.MqttFixedHeader;
import io.netty.handler.codec.mqtt.MqttMessage;
import io.netty.handler.codec.mqtt.MqttMessageType;
import io.netty.handler.codec.mqtt.MqttQoS;

/**
 * @author linfeng
 * @since 2016/11/22
 */
public class DisconnectMessage extends PushMessage {
    private static final long serialVersionUID = -8958796126612855716L;


    public DisconnectMessage(MqttMessage msg) {
        super(msg);
    }

    public MqttMessage build() {
        MqttFixedHeader fixedHeader = new MqttFixedHeader(MqttMessageType.DISCONNECT, false, MqttQoS.AT_MOST_ONCE, false, 0);
        return new MqttMessage(fixedHeader);
    }
}
